<script src="scripts/md5-min.js" type="text/javascript"></script>

<?php
if (!isset($_SESSION['UserID'])&& !isset($_SESSION['UserFirstName']) && !isset($_SESSION['UserLastName']) && !isset($_SESSION['UserRole']))
{ ?>
<div id="header">
    <div id="header_wrapper">
        <form action="func/loginHandler.php" method="post" name="login">
            <table border="0" width="960px">
                <tr>
                    <td width="320px"></td>
                    <td width="320px" id="fh_header_text" align="right">Username <input class="text_reg" id="txtUserName" name="txtUserName" type="text" /></td>
                    <td width="320px" id="fh_header_text" align="right">Password <input class="text_reg" id ="txtPassword" name="txtPassword" type="password" /> <input type="hidden" name="txtEncPassword" id="txtEncPassword" /> <input class="login_button" name="Login" type="submit" value="Login" onclick="document.getElementById('txtEncPassword').value = hex_md5(document.getElementById('txtPassword').value)" /></td>
                </tr>
            </table>
    <!--User Name <input id="txtUserName" name="txtUserName" type="text" /> Password <input id ="txtPassword" name="txtPassword" type="password" /> <input type="hidden" name="txtEncPassword" id="txtEncPassword" /> <input name="Login" type="submit" onclick="document.getElementById('txtEncPassword').value = hex_md5(document.getElementById('txtPassword').value)" />-->
        </form>
    </div>
</div>
<?php
}
else
{
?>

<div id="header">
    <div id="header_wrapper">
        <table border="0" width="960px">
            <tr>
                <td width="320px" id="fh_header_text" align="left" valign="middle"><?php echo date("l, F d, Y"); ?></td>
                <td width="320px" id="fh_header_text" align="right" valign="middle"><?php echo "Welcome " . $_SESSION['UserFirstName'] . " " . $_SESSION['UserLastName'] . ". "; ?></td>
                <td width="320px" id="fh_header_text" align="right" valign="middle"><a href="func/logoutHandler.php">Logout</a></td>
            </tr>
        </table>
    </div>
</div>

<?php
}
?>
<div id="title_bar">
    <div id="title_bar_wrapper">
        <table border="0" width="960px">
            <tr>
                <td width="100px"><img src="images/logo.jpg" width="100px" height="100px" /></td>
                <td>
                    <div id="fh_large">Kotahena Central College<br /></div>
                    <div id="fh_small">Colombo 13<br /></div>
                    <div id="fh_regular">Library Information and Management System </div>
                </td>
            </tr>
        </table>
    </div>
</div>